﻿<Window
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
		xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
		mc:Ignorable="d" 
		x:Class="Reporter.Controls.NewProjectDialogBox"
		xmlns:data="clr-namespace:Reporter.Data"
		xmlns:controls="clr-namespace:Reporter.Controls"
        xmlns:models="clr-namespace:ReporterControlLibrary.Models;assembly=ReporterControlLibrary"
		xmlns:system="clr-namespace:System;assembly=mscorlib" 
        Title="New Project"
        Height="260"
        Width="460"
        MinHeight="10"
        MinWidth="300"
        ResizeMode="NoResize"
        ShowInTaskbar="False"
        WindowStartupLocation="CenterOwner" 
        FocusManager.FocusedElement="{Binding ElementName=ProjectName_tb}" 
        Background="{x:Null}" AllowsTransparency="True" WindowStyle="None">
	
	<Window.Resources>		
        <models:Project x:Key="TempProject" />
		<models:ProjectPreferences x:Key="ProjectInfoDataSource" Project="{StaticResource TempProject}" ShowWarnings="True" SuspendOnError="True" DateFormat="yyyy-mm-dd" d:IsDataSource="True" />
	</Window.Resources>
	
    <Grid x:Name="LayoutRoot" DataContext="{Binding Source={StaticResource ProjectInfoDataSource}}">
		<Border x:Name="OuterPanel" Background="{DynamicResource TextBrush}" Style="{DynamicResource ApplicationOuterPanelBorderStyle}">
			<Border.Effect>
				<DropShadowEffect Opacity="0.6" ShadowDepth="3" BlurRadius="10" Direction="320"/>
			</Border.Effect>
			<Border x:Name="Panel" Background="{DynamicResource ApplicationPanelBackgroundBrush}" Style="{DynamicResource ApplicationPanelBorderStyle}">
				<Grid Margin="5">
					<Border Background="{DynamicResource ControlBackgroundLightOpaqueBrush}" BorderBrush="{DynamicResource ApplicationPanelBackgroundBrush}" Style="{DynamicResource ApplicationInnerPanelBorderStyle}" Margin="0,30,0,0" >
						<Grid >
							<Grid.RowDefinitions>
								<RowDefinition Height="35"/>
								<RowDefinition Height="35"/>
								<RowDefinition Height="35"/>
								<RowDefinition Height="35"/>
								<RowDefinition/>
								<RowDefinition Height="30"/>
							</Grid.RowDefinitions>
							<Grid.ColumnDefinitions>
								<ColumnDefinition Width="88"/>
								<ColumnDefinition Width="212.936"/>
								<ColumnDefinition/>
							</Grid.ColumnDefinitions>
							<TextBlock Text="Project Name" VerticalAlignment="Center" Margin="0,0,5,0" Foreground="{DynamicResource FormLabelBrush}" HorizontalAlignment="Right" Style="{DynamicResource FormLabelStyle}" />
							<TextBox x:Name="ProjectName_tb" VerticalAlignment="Center" Grid.Column="1" Margin="0,0,5,0" Text="{Binding Project.Name, Mode=TwoWay}" Grid.ColumnSpan="2" />
							<ComboBox x:Name="DateFormat_cb" IsEditable="True" ItemsSource="{x:Static data:AppData.DateFormats}" Text="{Binding DateFormat, Mode=TwoWay}" Grid.Row="1" Grid.Column="1" VerticalAlignment="Center" Width="200" HorizontalAlignment="Left" SelectedIndex="1" />
							<TextBlock TextWrapping="Wrap" HorizontalAlignment="Right" Grid.Row="1" VerticalAlignment="Center" Text="Date format" Foreground="{DynamicResource FormLabelBrush}" Margin="0,0,5,0" Style="{DynamicResource FormLabelStyle}"/>
							<CheckBox Content="Suspend generation process on error" d:LayoutOverrides="Width" Grid.Row="2" Grid.ColumnSpan="3" VerticalAlignment="Center" IsChecked="{Binding SuspendOnError}" Margin="10,0,0,0" Style="{DynamicResource FormCheckBoxStyle}"/>
							<CheckBox Content="Show warnings" d:LayoutOverrides="Width" Grid.Row="3" Grid.ColumnSpan="3" VerticalAlignment="Center" IsChecked="{Binding ShowWarnings}" Margin="10,0,0,0"/>
							<StackPanel Orientation="Horizontal" Grid.Column="2" Grid.Row="5" VerticalAlignment="Top" Margin="21,0,5,0" d:LayoutOverrides="Width">
								<Button x:Name="OK_bt" Click="OkBtClick" Content="OK" Padding="5" Height="25" Margin="0,0,5,0" Width="50"/>
								<Button x:Name="Cancel_bt" Click="CancelBtClick" Content="Cancel" Padding="5" Height="25" Width="50"/>
							</StackPanel>
                            <TextBlock x:Name="SampleDate_tb" Text="{Binding ElementName=DateFormat_cb, Path=Text, Converter={StaticResource DateFormatConverter}, ConverterParameter={StaticResource ProjectInfoDataSource}}" Foreground="{DynamicResource LightBrush}" HorizontalAlignment="Left" Grid.Column="2" Grid.Row="1" d:LayoutOverrides="Height" VerticalAlignment="Center"/>
                        </Grid>
					</Border>
					<TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="New Project" VerticalAlignment="Top" Foreground="{DynamicResource TextBrush}" FontSize="16" d:LayoutOverrides="VerticalAlignment"/>
       
				</Grid>
       
			</Border>
       
		</Border>
	</Grid>
</Window>
